
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>django.urls utility functions &#8212; Django 2.2.12.dev20200304094918 documentation</title>
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="django.urls functions for use in URLconfs" href="urls.html" />
    <link rel="prev" title="Unicode data" href="unicode.html" />



 
<script type="text/javascript" src="../templatebuiltins.js"></script>
<script type="text/javascript">
(function($) {
    if (!django_template_builtins) {
       // templatebuiltins.js missing, do nothing.
       return;
    }
    $(document).ready(function() {
        // Hyperlink Django template tags and filters
        var base = "templates/builtins.html";
        if (base == "#") {
            // Special case for builtins.html itself
            base = "";
        }
        // Tags are keywords, class '.k'
        $("div.highlight\\-html\\+django span.k").each(function(i, elem) {
             var tagname = $(elem).text();
             if ($.inArray(tagname, django_template_builtins.ttags) != -1) {
                 var fragment = tagname.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>");
             }
        });
        // Filters are functions, class '.nf'
        $("div.highlight\\-html\\+django span.nf").each(function(i, elem) {
             var filtername = $(elem).text();
             if ($.inArray(filtername, django_template_builtins.tfilters) != -1) {
                 var fragment = filtername.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>");
             }
        });
    });
})(jQuery);</script>

  </head><body>

    <div class="document">
  <div id="custom-doc" class="yui-t6">
    <div id="hd">
      <h1><a href="../index.html">Django 2.2.12.dev20200304094918 documentation</a></h1>
      <div id="global-nav">
        <a title="Home page" href="../index.html">Home</a>  |
        <a title="Table of contents" href="../contents.html">Table of contents</a>  |
        <a title="Global index" href="../genindex.html">Index</a>  |
        <a title="Module index" href="../py-modindex.html">Modules</a>
      </div>
      <div class="nav">
    &laquo; <a href="unicode.html" title="Unicode data">previous</a>
     |
    <a href="index.html" title="API Reference" accesskey="U">up</a>
   |
    <a href="urls.html" title="&lt;code class=&#34;docutils literal notranslate&#34;&gt;&lt;span class=&#34;pre&#34;&gt;django.urls&lt;/span&gt;&lt;/code&gt; functions for use in URLconfs">next</a> &raquo;</div>
    </div>

    <div id="bd">
      <div id="yui-main">
        <div class="yui-b">
          <div class="yui-g" id="ref-urlresolvers">
            
  <div class="section" id="s-module-django.urls">
<span id="s-django-urls-utility-functions"></span><span id="module-django.urls"></span><span id="django-urls-utility-functions"></span><h1><code class="docutils literal notranslate"><span class="pre">django.urls</span></code> utility functions<a class="headerlink" href="#module-django.urls" title="Permalink to this headline">¶</a></h1>
<div class="section" id="s-reverse">
<span id="reverse"></span><h2><code class="docutils literal notranslate"><span class="pre">reverse()</span></code><a class="headerlink" href="#reverse" title="Permalink to this headline">¶</a></h2>
<p>If you need to use something similar to the <a class="reference internal" href="templates/builtins.html#std:templatetag-url"><code class="xref std std-ttag docutils literal notranslate"><span class="pre">url</span></code></a> template tag in
your code, Django provides the following function:</p>
<dl class="function">
<dt id="django.urls.reverse">
<code class="descname">reverse</code>(<em>viewname</em>, <em>urlconf=None</em>, <em>args=None</em>, <em>kwargs=None</em>, <em>current_app=None</em>)<a class="reference internal" href="../_modules/django/urls/base.html#reverse"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django.urls.reverse" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p><code class="docutils literal notranslate"><span class="pre">viewname</span></code> can be a <a class="reference internal" href="../topics/http/urls.html#naming-url-patterns"><span class="std std-ref">URL pattern name</span></a> or the
callable view object. For example, given the following <code class="docutils literal notranslate"><span class="pre">url</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">news</span> <span class="k">import</span> <span class="n">views</span>

<span class="n">path</span><span class="p">(</span><span class="s1">&#39;archive/&#39;</span><span class="p">,</span> <span class="n">views</span><span class="o">.</span><span class="n">archive</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s1">&#39;news-archive&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>you can use any of the following to reverse the URL:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># using the named URL</span>
<span class="n">reverse</span><span class="p">(</span><span class="s1">&#39;news-archive&#39;</span><span class="p">)</span>

<span class="c1"># passing a callable object</span>
<span class="c1"># (This is discouraged because you can&#39;t reverse namespaced views this way.)</span>
<span class="kn">from</span> <span class="nn">news</span> <span class="k">import</span> <span class="n">views</span>
<span class="n">reverse</span><span class="p">(</span><span class="n">views</span><span class="o">.</span><span class="n">archive</span><span class="p">)</span>
</pre></div>
</div>
<p>If the URL accepts arguments, you may pass them in <code class="docutils literal notranslate"><span class="pre">args</span></code>. For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">django.urls</span> <span class="k">import</span> <span class="n">reverse</span>

<span class="k">def</span> <span class="nf">myview</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
    <span class="k">return</span> <span class="n">HttpResponseRedirect</span><span class="p">(</span><span class="n">reverse</span><span class="p">(</span><span class="s1">&#39;arch-summary&#39;</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">[</span><span class="mi">1945</span><span class="p">]))</span>
</pre></div>
</div>
<p>You can also pass <code class="docutils literal notranslate"><span class="pre">kwargs</span></code> instead of <code class="docutils literal notranslate"><span class="pre">args</span></code>. For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">reverse</span><span class="p">(</span><span class="s1">&#39;admin:app_list&#39;</span><span class="p">,</span> <span class="n">kwargs</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;app_label&#39;</span><span class="p">:</span> <span class="s1">&#39;auth&#39;</span><span class="p">})</span>
<span class="go">&#39;/admin/auth/&#39;</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">args</span></code> and <code class="docutils literal notranslate"><span class="pre">kwargs</span></code> cannot be passed to <code class="docutils literal notranslate"><span class="pre">reverse()</span></code> at the same time.</p>
<p>If no match can be made, <code class="docutils literal notranslate"><span class="pre">reverse()</span></code> raises a
<a class="reference internal" href="exceptions.html#django.urls.NoReverseMatch" title="django.urls.NoReverseMatch"><code class="xref py py-class docutils literal notranslate"><span class="pre">NoReverseMatch</span></code></a> exception.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">reverse()</span></code> function can reverse a large variety of regular expression
patterns for URLs, but not every possible one. The main restriction at the
moment is that the pattern cannot contain alternative choices using the
vertical bar (<code class="docutils literal notranslate"><span class="pre">&quot;|&quot;</span></code>) character. You can quite happily use such patterns for
matching against incoming URLs and sending them off to views, but you cannot
reverse such patterns.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">current_app</span></code> argument allows you to provide a hint to the resolver
indicating the application to which the currently executing view belongs.
This <code class="docutils literal notranslate"><span class="pre">current_app</span></code> argument is used as a hint to resolve application
namespaces into URLs on specific application instances, according to the
<a class="reference internal" href="../topics/http/urls.html#topics-http-reversing-url-namespaces"><span class="std std-ref">namespaced URL resolution strategy</span></a>.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">urlconf</span></code> argument is the URLconf module containing the URL patterns to
use for reversing. By default, the root URLconf for the current thread is used.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>The string returned by <code class="docutils literal notranslate"><span class="pre">reverse()</span></code> is already
<a class="reference internal" href="unicode.html#uri-and-iri-handling"><span class="std std-ref">urlquoted</span></a>. For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">reverse</span><span class="p">(</span><span class="s1">&#39;cities&#39;</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;Orléans&#39;</span><span class="p">])</span>
<span class="go">&#39;.../Orl%C3%A9ans/&#39;</span>
</pre></div>
</div>
<p class="last">Applying further encoding (such as <a class="reference external" href="https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote" title="(in Python v3.8)"><code class="xref py py-func docutils literal notranslate"><span class="pre">urllib.parse.quote()</span></code></a>) to the output
of <code class="docutils literal notranslate"><span class="pre">reverse()</span></code> may produce undesirable results.</p>
</div>
</div>
<div class="section" id="s-reverse-lazy">
<span id="reverse-lazy"></span><h2><code class="docutils literal notranslate"><span class="pre">reverse_lazy()</span></code><a class="headerlink" href="#reverse-lazy" title="Permalink to this headline">¶</a></h2>
<p>A lazily evaluated version of <a class="reference internal" href="#reverse">reverse()</a>.</p>
<dl class="function">
<dt id="django.urls.reverse_lazy">
<code class="descname">reverse_lazy</code>(<em>viewname</em>, <em>urlconf=None</em>, <em>args=None</em>, <em>kwargs=None</em>, <em>current_app=None</em>)<a class="headerlink" href="#django.urls.reverse_lazy" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>It is useful for when you need to use a URL reversal before your project’s
URLConf is loaded. Some common cases where this function is necessary are:</p>
<ul class="simple">
<li>providing a reversed URL as the <code class="docutils literal notranslate"><span class="pre">url</span></code> attribute of a generic class-based
view.</li>
<li>providing a reversed URL to a decorator (such as the <code class="docutils literal notranslate"><span class="pre">login_url</span></code> argument
for the <a class="reference internal" href="../topics/auth/default.html#django.contrib.auth.decorators.permission_required" title="django.contrib.auth.decorators.permission_required"><code class="xref py py-func docutils literal notranslate"><span class="pre">django.contrib.auth.decorators.permission_required()</span></code></a>
decorator).</li>
<li>providing a reversed URL as a default value for a parameter in a function’s
signature.</li>
</ul>
</div>
<div class="section" id="s-resolve">
<span id="resolve"></span><h2><code class="docutils literal notranslate"><span class="pre">resolve()</span></code><a class="headerlink" href="#resolve" title="Permalink to this headline">¶</a></h2>
<p>The <code class="docutils literal notranslate"><span class="pre">resolve()</span></code> function can be used for resolving URL paths to the
corresponding view functions. It has the following signature:</p>
<dl class="function">
<dt id="django.urls.resolve">
<code class="descname">resolve</code>(<em>path</em>, <em>urlconf=None</em>)<a class="reference internal" href="../_modules/django/urls/base.html#resolve"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django.urls.resolve" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p><code class="docutils literal notranslate"><span class="pre">path</span></code> is the URL path you want to resolve. As with
<a class="reference internal" href="#django.urls.reverse" title="django.urls.reverse"><code class="xref py py-func docutils literal notranslate"><span class="pre">reverse()</span></code></a>, you don’t need to worry about the <code class="docutils literal notranslate"><span class="pre">urlconf</span></code>
parameter. The function returns a <a class="reference internal" href="#django.urls.ResolverMatch" title="django.urls.ResolverMatch"><code class="xref py py-class docutils literal notranslate"><span class="pre">ResolverMatch</span></code></a> object that allows you
to access various metadata about the resolved URL.</p>
<p>If the URL does not resolve, the function raises a
<a class="reference internal" href="exceptions.html#django.urls.Resolver404" title="django.urls.Resolver404"><code class="xref py py-exc docutils literal notranslate"><span class="pre">Resolver404</span></code></a> exception (a subclass of
<a class="reference internal" href="../topics/http/views.html#django.http.Http404" title="django.http.Http404"><code class="xref py py-class docutils literal notranslate"><span class="pre">Http404</span></code></a>) .</p>
<dl class="class">
<dt id="django.urls.ResolverMatch">
<em class="property">class </em><code class="descname">ResolverMatch</code><a class="reference internal" href="../_modules/django/urls/resolvers.html#ResolverMatch"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django.urls.ResolverMatch" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="django.urls.ResolverMatch.func">
<code class="descname">func</code><a class="headerlink" href="#django.urls.ResolverMatch.func" title="Permalink to this definition">¶</a></dt>
<dd><p>The view function that would be used to serve the URL</p>
</dd></dl>

<dl class="attribute">
<dt id="django.urls.ResolverMatch.args">
<code class="descname">args</code><a class="headerlink" href="#django.urls.ResolverMatch.args" title="Permalink to this definition">¶</a></dt>
<dd><p>The arguments that would be passed to the view function, as
parsed from the URL.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.urls.ResolverMatch.kwargs">
<code class="descname">kwargs</code><a class="headerlink" href="#django.urls.ResolverMatch.kwargs" title="Permalink to this definition">¶</a></dt>
<dd><p>The keyword arguments that would be passed to the view
function, as parsed from the URL.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.urls.ResolverMatch.url_name">
<code class="descname">url_name</code><a class="headerlink" href="#django.urls.ResolverMatch.url_name" title="Permalink to this definition">¶</a></dt>
<dd><p>The name of the URL pattern that matches the URL.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.urls.ResolverMatch.route">
<code class="descname">route</code><a class="headerlink" href="#django.urls.ResolverMatch.route" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<span class="title">New in Django 2.2.</span> </div>
<p>The route of the matching URL pattern.</p>
<p>For example, if <code class="docutils literal notranslate"><span class="pre">path('users/&lt;id&gt;/',</span> <span class="pre">...)</span></code> is the matching pattern,
<code class="docutils literal notranslate"><span class="pre">route</span></code> will contain <code class="docutils literal notranslate"><span class="pre">'users/&lt;id&gt;/'</span></code>.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.urls.ResolverMatch.app_name">
<code class="descname">app_name</code><a class="headerlink" href="#django.urls.ResolverMatch.app_name" title="Permalink to this definition">¶</a></dt>
<dd><p>The application namespace for the URL pattern that matches the
URL.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.urls.ResolverMatch.app_names">
<code class="descname">app_names</code><a class="headerlink" href="#django.urls.ResolverMatch.app_names" title="Permalink to this definition">¶</a></dt>
<dd><p>The list of individual namespace components in the full
application namespace for the URL pattern that matches the URL.
For example, if the <code class="docutils literal notranslate"><span class="pre">app_name</span></code> is <code class="docutils literal notranslate"><span class="pre">'foo:bar'</span></code>, then <code class="docutils literal notranslate"><span class="pre">app_names</span></code>
will be <code class="docutils literal notranslate"><span class="pre">['foo',</span> <span class="pre">'bar']</span></code>.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.urls.ResolverMatch.namespace">
<code class="descname">namespace</code><a class="headerlink" href="#django.urls.ResolverMatch.namespace" title="Permalink to this definition">¶</a></dt>
<dd><p>The instance namespace for the URL pattern that matches the
URL.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.urls.ResolverMatch.namespaces">
<code class="descname">namespaces</code><a class="headerlink" href="#django.urls.ResolverMatch.namespaces" title="Permalink to this definition">¶</a></dt>
<dd><p>The list of individual namespace components in the full
instance namespace for the URL pattern that matches the URL.
i.e., if the namespace is <code class="docutils literal notranslate"><span class="pre">foo:bar</span></code>, then namespaces will be
<code class="docutils literal notranslate"><span class="pre">['foo',</span> <span class="pre">'bar']</span></code>.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.urls.ResolverMatch.view_name">
<code class="descname">view_name</code><a class="headerlink" href="#django.urls.ResolverMatch.view_name" title="Permalink to this definition">¶</a></dt>
<dd><p>The name of the view that matches the URL, including the namespace if
there is one.</p>
</dd></dl>

</dd></dl>

<p>A <a class="reference internal" href="#django.urls.ResolverMatch" title="django.urls.ResolverMatch"><code class="xref py py-class docutils literal notranslate"><span class="pre">ResolverMatch</span></code></a> object can then be interrogated to provide
information about the URL pattern that matches a URL:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Resolve a URL</span>
<span class="n">match</span> <span class="o">=</span> <span class="n">resolve</span><span class="p">(</span><span class="s1">&#39;/some/path/&#39;</span><span class="p">)</span>
<span class="c1"># Print the URL pattern that matches the URL</span>
<span class="nb">print</span><span class="p">(</span><span class="n">match</span><span class="o">.</span><span class="n">url_name</span><span class="p">)</span>
</pre></div>
</div>
<p>A <a class="reference internal" href="#django.urls.ResolverMatch" title="django.urls.ResolverMatch"><code class="xref py py-class docutils literal notranslate"><span class="pre">ResolverMatch</span></code></a> object can also be assigned to a triple:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">func</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">kwargs</span> <span class="o">=</span> <span class="n">resolve</span><span class="p">(</span><span class="s1">&#39;/some/path/&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>One possible use of <a class="reference internal" href="#django.urls.resolve" title="django.urls.resolve"><code class="xref py py-func docutils literal notranslate"><span class="pre">resolve()</span></code></a> would be to test whether a
view would raise a <code class="docutils literal notranslate"><span class="pre">Http404</span></code> error before redirecting to it:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">urllib.parse</span> <span class="k">import</span> <span class="n">urlparse</span>
<span class="kn">from</span> <span class="nn">django.urls</span> <span class="k">import</span> <span class="n">resolve</span>
<span class="kn">from</span> <span class="nn">django.http</span> <span class="k">import</span> <span class="n">Http404</span><span class="p">,</span> <span class="n">HttpResponseRedirect</span>

<span class="k">def</span> <span class="nf">myview</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
    <span class="nb">next</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">META</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;HTTP_REFERER&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> <span class="ow">or</span> <span class="s1">&#39;/&#39;</span>
    <span class="n">response</span> <span class="o">=</span> <span class="n">HttpResponseRedirect</span><span class="p">(</span><span class="nb">next</span><span class="p">)</span>

    <span class="c1"># modify the request and response as required, e.g. change locale</span>
    <span class="c1"># and set corresponding locale cookie</span>

    <span class="n">view</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">kwargs</span> <span class="o">=</span> <span class="n">resolve</span><span class="p">(</span><span class="n">urlparse</span><span class="p">(</span><span class="nb">next</span><span class="p">)[</span><span class="mi">2</span><span class="p">])</span>
    <span class="n">kwargs</span><span class="p">[</span><span class="s1">&#39;request&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">request</span>
    <span class="k">try</span><span class="p">:</span>
        <span class="n">view</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
    <span class="k">except</span> <span class="n">Http404</span><span class="p">:</span>
        <span class="k">return</span> <span class="n">HttpResponseRedirect</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">)</span>
    <span class="k">return</span> <span class="n">response</span>
</pre></div>
</div>
</div>
<div class="section" id="s-get-script-prefix">
<span id="get-script-prefix"></span><h2><code class="docutils literal notranslate"><span class="pre">get_script_prefix()</span></code><a class="headerlink" href="#get-script-prefix" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="django.urls.get_script_prefix">
<code class="descname">get_script_prefix</code>()<a class="reference internal" href="../_modules/django/urls/base.html#get_script_prefix"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#django.urls.get_script_prefix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>Normally, you should always use <a class="reference internal" href="#django.urls.reverse" title="django.urls.reverse"><code class="xref py py-func docutils literal notranslate"><span class="pre">reverse()</span></code></a> to define URLs
within your application. However, if your application constructs part of the
URL hierarchy itself, you may occasionally need to generate URLs. In that
case, you need to be able to find the base URL of the Django project within
its Web server (normally, <a class="reference internal" href="#django.urls.reverse" title="django.urls.reverse"><code class="xref py py-func docutils literal notranslate"><span class="pre">reverse()</span></code></a> takes care of this for
you). In that case, you can call <code class="docutils literal notranslate"><span class="pre">get_script_prefix()</span></code>, which will return
the script prefix portion of the URL for your Django project. If your Django
project is at the root of its web server, this is always <code class="docutils literal notranslate"><span class="pre">&quot;/&quot;</span></code>.</p>
</div>
</div>


          </div>
        </div>
      </div>
      
        
          <div class="yui-b" id="sidebar">
            
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#"><code class="docutils literal notranslate"><span class="pre">django.urls</span></code> utility functions</a><ul>
<li><a class="reference internal" href="#reverse"><code class="docutils literal notranslate"><span class="pre">reverse()</span></code></a></li>
<li><a class="reference internal" href="#reverse-lazy"><code class="docutils literal notranslate"><span class="pre">reverse_lazy()</span></code></a></li>
<li><a class="reference internal" href="#resolve"><code class="docutils literal notranslate"><span class="pre">resolve()</span></code></a></li>
<li><a class="reference internal" href="#get-script-prefix"><code class="docutils literal notranslate"><span class="pre">get_script_prefix()</span></code></a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="unicode.html"
                        title="previous chapter">Unicode data</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="urls.html"
                        title="next chapter"><code class="docutils literal notranslate"><span class="pre">django.urls</span></code> functions for use in URLconfs</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/ref/urlresolvers.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
              <h3>Last update:</h3>
              <p class="topless">Mar 04, 2020</p>
          </div>
        
      
    </div>

    <div id="ft">
      <div class="nav">
    &laquo; <a href="unicode.html" title="Unicode data">previous</a>
     |
    <a href="index.html" title="API Reference" accesskey="U">up</a>
   |
    <a href="urls.html" title="&lt;code class=&#34;docutils literal notranslate&#34;&gt;&lt;span class=&#34;pre&#34;&gt;django.urls&lt;/span&gt;&lt;/code&gt; functions for use in URLconfs">next</a> &raquo;</div>
    </div>
  </div>

      <div class="clearer"></div>
    </div>
  </body>
</html>